package com.brillilab.service.logic.space;

import com.brillilab.domain.vo.space.KitBoxVo;
import com.brillilab.domain.vo.user.UserInfoVo;
import com.brillilab.service.core.space.IKitBoxService;
import com.brillilab.service.core.system.IDictService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author wuzhiyu
 * @Title: KitBoxLogic
 * @ProjectName brill_lab
 * @Description: TODO
 * @date 2019/5/1419:36
 */
@Service
@Transactional
public class KitBoxLogic {
    @Resource
    private IDictService dictService;
    @Resource
    private IKitBoxService kitBoxService;

    public List<KitBoxVo> list(Long panelId, UserInfoVo user){
        List<KitBoxVo> list =kitBoxService.list(panelId,user);
        Map<Integer,String> zone = dictService.getZoneMap();
        list.forEach(k->{
            k.setZoneName(zone.get(k.getZone()));
        });
        return list;
    }
}
